﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using RTUDataAcquisition.DataAccess;

namespace RTUDataAcquisition
{
    public partial class EssShow : Form
    {
        public EssShow(string strStationNo, string strStationName, string strTimes)
        {
            InitializeComponent();
            dataGridView1.AutoGenerateColumns = false;
            labInfo.Text = "编号：" + strStationNo + "   名称：" + strStationName;
            DataTable dt = DataBusiness.GetStationEssData(strStationNo, strTimes);
            dataGridView1.DataSource = dt;
        }

        private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            Rectangle rectangle = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, dataGridView1.RowHeadersWidth, e.RowBounds.Height);
            TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
            dataGridView1.RowHeadersDefaultCellStyle.Font, rectangle, dataGridView1.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter);
        }
    }
}
